﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="sql-script-generate-from-csv.aspx.cs" Inherits="Dala.Samples.Sql_Script_Generate_From_CSV.sql_script_generate_from_csv" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <title>SQL Script Generate From CSV File</title>
    <style type="text/css">
        .error, .notice, .success
        {
            padding: .8em;
            margin-bottom: 1em;
            border: 2px solid #ddd;
        }
        .error
        {
            background: #FBE3E4;
            color: #8a1f11;
            border-color: #FBC2C4;
        }
        .notice
        {
            background: #FFF6BF;
            color: #514721;
            border-color: #FFD324;
        }
        .success
        {
            background: #E6EFC2;
            color: #264409;
            border-color: #C6D880;
        }
        .error a
        {
            color: #8a1f11;
        }
        .notice a
        {
            color: #514721;
        }
        .success a
        {
            color: #264409;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div>
        <div>
            <h1>
                Import CSV File To Generate SQL Script</h1>
        </div>
        <div id="divMessage" runat="server" style="display: none;">
        </div>
        <asp:FileUpload ID="flucsv" runat="server" />
        <asp:RequiredFieldValidator ID="rfvCSV" runat="server" ErrorMessage="Please Select a file first"
            ValidationGroup="validate" Display="Dynamic" ControlToValidate="flucsv">
        </asp:RequiredFieldValidator>
        <asp:RegularExpressionValidator ID="revCSV" runat="server" ErrorMessage="Upload .CSV File only"
            ValidationGroup="validate" Display="Dynamic" ValidationExpression="^.*\.(csv|CSV)$"
            ControlToValidate="flucsv">
        </asp:RegularExpressionValidator>
        <asp:Button ID="btnUpload" Text="Upload" runat="server" OnClick="UploadCsvDataToDatabase"
            CausesValidation="true" ValidationGroup="validate" />
    </div>
</asp:Content>
